package com.tbit.uqbike.webmanager.controller;

import com.github.pagehelper.PageInfo;
import com.tbit.uqbike.object.pojo.UserScoreLog;
import com.tbit.uqbike.object.view.JsonResult;
import com.tbit.uqbike.service.business.UserScoreLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 用户信用分日志Controller
 *
 * @author jing
 * @date 2021-06-01
 */
@RestController
@RequestMapping("/userScoreLog")
public class UserScoreLogController extends BaseController {
    @Autowired
    private UserScoreLogService userScoreLogService;

    /**
     * 查询用户信用分日志列表
     */
    @GetMapping("/list")
    public JsonResult list(UserScoreLog userScoreLog) {
        startPage();
        List<UserScoreLog> list = userScoreLogService.selectUserScoreLogList(userScoreLog);
        return JsonResult.ok(list, (int) new PageInfo<>(list).getTotal());
    }
}
